<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app"></div>
  <script src="./vue.js"></script>
  <script>
    new Vue({
      el: '#app',
      data: {
        msg: 'qwer'
      },
      beforeCreate() {
        console.log('beforeCreated')
      },
      created() {  //  初始化：  数据初始化, 也可以发ajax
        console.log('created')
        this.msg = '1234'
      },
      mounted() {  // 当页面挂在完之后的函数 ajax操作
        console.log('mounted')
      },
      updated() {  // 当数据发生一些改变

      },
      destroyed() {  // 销毁  关闭定时器，移除没用变量

      }  
    })
  </script>
</body>
</html>